program testsum
	implicit none
	integer, dimension(2,2,2)::a
	integer:: i,j,k
	do i=1, 2
		do j=1, 2
			do k = 1, 2
				a(i,j,k) = 1
			end do
		end do
	end do

	print *, sum(a(:,1,:))
end program
